OpenJs mysql not reading database [migrated]

Posted by Benedikt Wutzi on Pro Webmasters See other posts from Pro Webmasters or by Benedikt Wutzi
Published on 2012-11-21T20:55:27Z Indexed on 2012/11/21 23:11 UTC
Read the original article Hit count: 458

Filed under:
|

I try to access a mysql table using OpenJs Grid. I already doublechecked if the database "partsdb" and the table "parts" exists and it can be accessed from the commandline.

Currently I'm using the must basic example:

members.php:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Members Page</title>
<script>
$(function() {
    $(".parts").grid();
});
</script>

</head>
<body>

<div id="container">
    <h1>Members Page</h1>

    <table action="ajax.php">
        <tr>
            <th col="id">Id</th>
            <th col="name">Name</th>
        </tr>
    </table>

    <a href='<?php echo base_url()."main/logout" ?>'>Logout</a>
</div>

and ajax.php

<?php
mysql_connect("localhost","****","*****");
mysql_select_db("partsdb");

require_once("grid.php");

$grid = new Grid("parts");


?>

When I run php directly on ajax.php I get an error telling me: " Unknown column 'parts.' in 'field list' " and the table shows only the headers.

What am I doing wrong?

© Pro Webmasters or respective owner

Related posts about php

Related posts about mysql